<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAnnouncesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('announces', function (Blueprint $table) {
            $table->increments('announce_id')->comment('主键');
            $table->string('title', 255)->comment('标题');
            $table->integer('admin_id')->comment('创建管理员ID');
            $table->string('admin_realname')->comment('发布者笔名');
            $table->string('style', 15)->comment('标题样式');
            $table->integer('type')->comment('公告类型0->url 1->内容');
            $table->string('content', 255)->comment('公告内容, 或许是内容, 或许是url');
            $table->timestamp('start_at')->comment('有效开始时间')->nullable();
            $table->timestamp('end_at')->comment('自动失效时间')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('announces');
    }
}
